package com.sbj.config;

import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.sbj.socket.TimeSocketServer;
import com.sbj.socket.WebSocketConfig;
import com.zmh.framework.exception.ResultException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * @author summer
 * @version 1.0
 * @date 2024/8/31 18:10
 */
@Slf4j
@AllArgsConstructor
public class DynamicThread implements Runnable {

    private Integer memberId;

    @Override
    public void run() {
        TimeSocketServer socketServer = SpringUtil.getBean(TimeSocketServer.class);
        try {
            socketServer.sendMessage("开始执行", memberId);
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
        log.info("开始执行");
    }
}
